function getFamtterTimer() {    //传入时间
    let date = new Date(),
    Y = date.getFullYear(), // 年  
    M = date.getMonth() + 1, //月  
    D = date.getDate(), //日
    h  = date.getHours(), //小时
    m  = date.getMinutes(), //分钟
    s  = date.getSeconds(); //秒数
    let timer = Y+ '-' + getZero(M) + '-' + getZero(D) + ' ' + getZero(h) + ':' + getZero(m) + ':' + getZero(s); 
    return timer;
}
function getZero(num){
    if(parseInt(num)<10){
        num = "0"+num;
    }
    return num;
}
function formatDate(value) {
    if (typeof (value) == 'undefined') {
        return ''
    } else {
        let date = new Date(parseInt(value))
        let y = date.getFullYear()
        let MM = date.getMonth() + 1
        MM = MM < 10 ? ('0' + MM) : MM
        let d = date.getDate()
        d = d < 10 ? ('0' + d) : d
        let h = date.getHours()
        h = h < 10 ? ('0' + h) : h
        let m = date.getMinutes()
        m = m < 10 ? ('0' + m) : m
        let s = date.getSeconds()
        s = s < 10 ? ('0' + s) : s
        return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s
    }
}
//请求接口
function sendAjax(url, type, data) {
    $.ajaxSettings.async = false;
    var results;
    $.ajax({
        type: type,
        dataType: "json",
        url: url,
        data: data,
        success: function(data) {
            results = data;
        },
        error: function(error) {
            results = error;
        }
    });
    return results;
}
function isNull(obj) {
    if (typeof obj == "undefined" || obj == null || obj == "" || obj.match(/^[ ]+$/)) {
        return true;
    } else {
        return false;
    }
}
function compare(key) {
    return function (value1, value2) {
        var val1 = value1[key]; var val2 = value2[key]; return val1 - val2;
    }
}